-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(axis): improved axis styles #711
Conversation
6651716
to
99149f9
Compare
99149f9
to
6a192c8
Compare
- add visibility to ticks, labels, line and overall axis - add style overrides for each axis that override theme axis styles - improve padding controls for axis titles, labels and ticks - add tick label offsets to tweek final position of tick labels
6a192c8
to
8e4ccb8
Compare
- update api docs and types - fix gridline visibility to use theme or showGridline prop - only translate canvas context when needed - remove stale properties - fix naming from latest variable and type changes - improve type descriptions - update theme values to match old padding theme config - fix type errors in stories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and works great!
I've left a comment on my previous review and I want to ask if, on the same PR, you think it's worth also removing/deprecating these two props showOverlappingTicks
and showOverlappingLabels
moving these to the style
Yeah I think we punt this decision until we make gridlines a first-class-citizen. I would also like to see nicing and a major/minor tick function like we talked about. Or even tick intervals like excel does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Axis improvements - Hide axis but show gridlines - hide axis titles, labels, ticks and line independently - add inner and outer padding to tick labels - add inner and outer padding to axes titles - transform offsets relative to local reference (i.e. rotated coordinates) - transform offsets relative to global reference - add tick label horizontal and vertical alignment closes #714, #312 BREAKING CHANGE: - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.tickLabelRotation` => `AxisStyle.tickLabel.rotation` - `AxisSpec.tickPadding` => `AxisStyle.tickLine.padding` - `AxisSpec.tickSize` => `AxisStyle.tickLine.size` - `AxisStyle.tickLabelPadding` => `AxisStyle.tickLabel.padding` - `GridLineConfig` => `GridLineStyle` - `AxisSpec.style` => `RecursivePartial<AxisStyle>` (new `AxisStyle` type) - `AxisConfig.axisLineStyle` => `AxisStyle.axisLine` - `AxisConfig.axisTitleStyle` => `AxisStyle.axisTitle` - `AxisConfig.tickLabelStyle` => `AxisStyle.tickLabel` - `AxisConfig.tickLineStyle` => `AxisStyle.tickLine` - `GridLineStyle` requires all properties - deprecate `AxisSpec.showGridLines` in favor of `AxisSpec.gridLine.visible`
# [20.0.0](v19.9.1...v20.0.0) (2020-07-19) ### Features * **axis:** improved axis styles ([#711](#711)) ([3c46f9c](3c46f9c)), closes [#714](#714) [#312](#312) ### BREAKING CHANGES * **axis:** - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.tickLabelRotation` => `AxisStyle.tickLabel.rotation` - `AxisSpec.tickPadding` => `AxisStyle.tickLine.padding` - `AxisSpec.tickSize` => `AxisStyle.tickLine.size` - `AxisStyle.tickLabelPadding` => `AxisStyle.tickLabel.padding` - `GridLineConfig` => `GridLineStyle` - `AxisSpec.style` => `RecursivePartial<AxisStyle>` (new `AxisStyle` type) - `AxisConfig.axisLineStyle` => `AxisStyle.axisLine` - `AxisConfig.axisTitleStyle` => `AxisStyle.axisTitle` - `AxisConfig.tickLabelStyle` => `AxisStyle.tickLabel` - `AxisConfig.tickLineStyle` => `AxisStyle.tickLine` - `GridLineStyle` requires all properties - deprecate `AxisSpec.showGridLines` in favor of `AxisSpec.gridLine.visible`
🎉 This PR is included in version 20.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This reverts commit 4f1a0b1.
# [20.0.0](elastic/elastic-charts@v19.9.1...v20.0.0) (2020-07-19) ### Features * **axis:** improved axis styles ([opensearch-project#711](elastic/elastic-charts#711)) ([e736aad](elastic/elastic-charts@e736aad)), closes [opensearch-project#714](elastic/elastic-charts#714) [opensearch-project#312](elastic/elastic-charts#312) ### BREAKING CHANGES * **axis:** - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.gridLineStyle` => `AxisSpec.gridLine` - `AxisSpec.tickLabelRotation` => `AxisStyle.tickLabel.rotation` - `AxisSpec.tickPadding` => `AxisStyle.tickLine.padding` - `AxisSpec.tickSize` => `AxisStyle.tickLine.size` - `AxisStyle.tickLabelPadding` => `AxisStyle.tickLabel.padding` - `GridLineConfig` => `GridLineStyle` - `AxisSpec.style` => `RecursivePartial<AxisStyle>` (new `AxisStyle` type) - `AxisConfig.axisLineStyle` => `AxisStyle.axisLine` - `AxisConfig.axisTitleStyle` => `AxisStyle.axisTitle` - `AxisConfig.tickLabelStyle` => `AxisStyle.tickLabel` - `AxisConfig.tickLineStyle` => `AxisStyle.tickLine` - `GridLineStyle` requires all properties - deprecate `AxisSpec.showGridLines` in favor of `AxisSpec.gridLine.visible`
Summary
closes #714, #312
Type Changes
visibility
toaxisTitle
,axisLine
andtickLabel
inner
andouter
properties toTextStyle.padding
. Still accepts numberBREAKING CHANGES
property name changes:
AxisSpec.gridLineStyle
=>AxisSpec.gridLine
AxisSpec.gridLineStyle
=>AxisSpec.gridLine
type changes:
AxisSpec.tickLabelRotation
=>AxisStyle.tickLabel.rotation
AxisSpec.tickPadding
=>AxisStyle.tickLine.padding
AxisSpec.tickSize
=>AxisStyle.tickLine.size
AxisStyle.tickLabelPadding
=>AxisStyle.tickLabel.padding
GridLineConfig
=>GridLineStyle
AxisSpec.style
=>RecursivePartial<AxisStyle>
(newAxisStyle
type)AxisConfig.axisLineStyle
=>AxisStyle.axisLine
AxisConfig.axisTitleStyle
=>AxisStyle.axisTitle
AxisConfig.tickLabelStyle
=>AxisStyle.tickLabel
AxisConfig.tickLineStyle
=>AxisStyle.tickLine
GridLineStyle
requires all propertiesAxisSpec.showGridLines
in favor ofAxisSpec.gridLine.visible
Axis improvements
inner
andouter
padding to tick labelsinner
andouter
padding to axes titleslocal
reference (i.e. rotated coordinates)global
referenceChecklist
Delete any items that are not applicable to this PR.
src/index.ts
(and stories only import from../src
except for test data & storybook)